import request from '@/router/axios'

export function GetMenu () {
  return request({
    url: '/sys/menu',
    method: 'get',
    params:{
    	'root':'admin'
    }
  })
}

export function fetchMenuEditTree (query) {
  return request({
    url: '/sys/menu/editTree',
    method: 'get',
    params: query
  })
}

// export function fetchMenuAuthTree (query) {
//   return request({
//     url: '/sys/menu/authTree',
//     method: 'get',
//     params: query
//   })
// }

export function addObj (obj) {
  return request({
    url: '/sys/menu',
    method: 'post',
    data: obj
  })
}

export function getObj (id) {
  return request({
    url: '/sys/menu/' + id,
    method: 'get'
  })
}

export function delObj (id) {
  return request({
    url: '/sys/menu/' + id,
    method: 'delete'
  })
}

export function putObj (obj) {
  return request({
    url: '/sys/menu',
    method: 'put',
    data: obj
  })
}
